package com.example.demo.repository;

import com.example.demo.entity.Role;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 角色dao层
 * Created by Administrator on 2017/11/9.
 */
@Transactional
@Repository
//@Qualifier("RoleRepository")
public interface RoleRepository extends CrudRepository<Role, Long > {

    @Query("select t from Role t where t.roleName=:roleName")
    List<Role> findRoleByName(@Param("roleName") String roleName);
}
